package com.xinchuang.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

/**
 * @TableName test_model_main_table
 */
@TableName(value = "test_model_main_table")
@Data
public class TestModelMainTable implements Serializable {
    /**
     * 标识ID
     */
    @TableId
    private String id;

    /**
     * 名称
     */
    private String planName;

    /**
     * 编号
     */
    private String serialNumber;

    /**
     * 版本
     */
    private String version;

    /**
     * 计划时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonIgnore
    private Date planTime;

    /**
     * 计划时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonIgnore
    private Date planTimeEnd;

    /**
     * 周ID
     */
    private String weekId;

    /**
     * 第几周名称
     */
    private String weekOfYear;

    /**
     * 计划编制人
     */
    private String planAuthor;

    /**
     * 表单状态
     */
    private String status;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonProperty(value = "addTime", access = JsonProperty.Access.READ_ONLY)
    private Date createTime;

    /**
     * 更改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 版次
     */
    private Integer edition;

    /**
     * 年份
     */
    private Integer year;

    /**
     * 星期
     */
    private Integer week;

    public TestModelMainTable() {
    }

    public TestModelMainTable(String id, String planName, String serialNumber, String version, Date planTime, Date planTimeEnd, String weekId, String weekOfYear, String planAuthor, String status, Date createTime, Date updateTime, int edition) {
        this.id = id;
        this.planName = planName;
        this.serialNumber = serialNumber;
        this.version = version;
        this.planTime = planTime;
        this.planTimeEnd = planTimeEnd;
        this.weekId = weekId;
        this.weekOfYear = weekOfYear;
        this.planAuthor = planAuthor;
        this.status = status;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.edition = edition;
    }

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TestModelMainTable other = (TestModelMainTable) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getPlanName() == null ? other.getPlanName() == null : this.getPlanName().equals(other.getPlanName()))
                && (this.getSerialNumber() == null ? other.getSerialNumber() == null : this.getSerialNumber().equals(other.getSerialNumber()))
                && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()))
                && (this.getPlanTime() == null ? other.getPlanTime() == null : this.getPlanTime().equals(other.getPlanTime()))
                && (this.getPlanTimeEnd() == null ? other.getPlanTimeEnd() == null : this.getPlanTimeEnd().equals(other.getPlanTimeEnd()))
                && (this.getWeekOfYear() == null ? other.getWeekOfYear() == null : this.getWeekOfYear().equals(other.getWeekOfYear()))
                && (this.getPlanAuthor() == null ? other.getPlanAuthor() == null : this.getPlanAuthor().equals(other.getPlanAuthor()))
                && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPlanName() == null) ? 0 : getPlanName().hashCode());
        result = prime * result + ((getSerialNumber() == null) ? 0 : getSerialNumber().hashCode());
        result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
        result = prime * result + ((getPlanTime() == null) ? 0 : getPlanTime().hashCode());
        result = prime * result + ((getPlanTimeEnd() == null) ? 0 : getPlanTimeEnd().hashCode());
        result = prime * result + ((getWeekOfYear() == null) ? 0 : getWeekOfYear().hashCode());
        result = prime * result + ((getPlanAuthor() == null) ? 0 : getPlanAuthor().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", planName=").append(planName);
        sb.append(", serialNumber=").append(serialNumber);
        sb.append(", version=").append(version);
        sb.append(", planTime=").append(planTime);
        sb.append(", planTimeEnd=").append(planTimeEnd);
        sb.append(", weekOfYear=").append(weekOfYear);
        sb.append(", planAuthor=").append(planAuthor);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}